A new framework for strictness analysis using abstract demand propagation

نویسنده

  • G. Tremblay
چکیده

This paper presents a novel approach to strictness analysis called abstract demand propagation, approach developed for the implementation of lazy functional programming languages on parallel machines. Although some work on strictness analysis using demand propagation has been done before, the present work is original in that it gives a precise interpretation of the notions of demands and demand propagation using an exact non-standard denotational semantics. The intuition behind this semantics is that it represents a form of inverse computation, i.e., it determines the least amount of information needed to produce at least some required (demanded) result. Viewing demand propagation as a form of inverse computation allows to establish the soundness of our non-standard semantics by formally relating it with the standard semantics. In order to deene a compile-time analysis based on demand propagation, safety and termination must be ensured. This is done by deening an abstract interpretation of the exact non-standard demand propagation semantics, thus providing an abstract demand propagation semantics. This abstraction makes it possible to express various generalized strictness properties: deenite non-termination, argument not needed, various levels of strictness for data structures, including the important property of head-strictness, etc. Furthermore, the safety of this abstraction can also be established through the notion of inverse, because any superset of an inverse can easily be shown to also be an inverse. Our abstract demand propagation approach has been incorporated into a prototype compiler for a lazy variant of (a subset of) the Id functional programming language targeted for a ne-grain dataaow machine. Abstract demand propagation provided a naturally parallel framework for the implementation of a lazy language. It also made possible the incorporation of a number of additional features: function specialization, abstract conditions, run-time demands. This compiler is brieey described, together with some of the additional features it incorporates. A brief overview of the results from experiments performed with the compiler are also presented, experiments whose goal was to determine the impact of laziness on parallelism. 1 Introduction One of the major motivation for functional programming languages is as an alternative programming paradigm, especially for programming parallel machines Bac78, Hud89]. Functional programs are naturally parallel | the parallelism is implicit, based on the data dependencies | and determi-nate | any order of evaluation always produces the same result. As is well-known, the implementation of lazy languages requires much overhead Hen80]. Fortunately, it is often possible to avoid part of this …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Higher Order Demand Propagation

In this report a new backward strictness analysis for functional languages is presented. It is called higher order demand propagation and is applicable to a realistic non-strict functional language, which has a polymorphic type system and supports higher order functions and user definable algebraic data types. This report defines a semantics for higher order demand propagation and relates it to...

متن کامل

Demand analysis with partial predicates

In order to alleviate the inefficiencies caused by the interaction of the logic and functional sides, integrated languages may take advantage of demand information — i.e. knowing in advance which computations are needed and, to which extent, in a particular context. This work studies demand analysis – which is closely related to backwards strictness analysis – in a semantic framework of partial...

متن کامل

Strictness Analysis for Attribute Grammars

Attribute grammars may be seen as a (rather specialised) lazy or demand-driven programming language. The “programs” in this language take text or parse trees as input and return values of the synthesised attributes to the root as output. From this observation we establish a framework for abstract interpretation of attribute grammars. The framework is used to construct a strictness analysis for ...

متن کامل

The Impact of Laziness on Parallelism and the Limits of Strictness Analysis

The major question examined by this paper is whether suucient ne-grain parallelism can be obtained from programs written in a lazy functional language. To answer this question, we have implemented a prototype compiler based on a novel approach to strictness analysis (called abstract demand propagation) and we have compared this implementation strategy (optimized lazy) with other implementations...

متن کامل

The Impact of Laziness on Parallelism and the Limits of StrictnessAnalysisG

The major question examined by this paper is whether suucient ne-grain parallelism can be obtained from programs written in a lazy functional language. To answer this question, we have implemented a prototype compiler based on a novel approach to strictness analysis (called abstract demand propagation) and we have compared this implementation strategy (optimized lazy) with other implementations...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007